// 头部导航指令
define('dateInputDirective', ['angular','jquery','datetimepicker'], function (angular,$,datetimepicker) {
    var m = angular.module('directives');
    m.directive('dateInput', [function () {
        return {
            restrict: 'AE',
            templateUrl: 'js/templates/dateInput.html',
            replace: true,
            scope:{
            	styleDate:'@',
                getDate:'=?',
                readOnly:'=?'
            },
            link: function (scope, elem, attr) {
                $(elem).find('input').datetimepicker({
                    format: scope.styleDate
                });
            },
            controller:['$scope',function($scope){
                $scope.dateChange=function ($event) {
                    $scope.getDate=$($event.target).val();
                };
                $scope.$watch("getDate",function(n,o){
                    $scope.currentDate=n;
                });
            }]
        };
    }]);
});